

def gene_convs(query, ans, id='', format=''):
    if format == 'glm4':
        conv = [{'role': 'user', 'content': query}, {'role': 'assistant',                               'content': ans
                                                                }]
        cur = {'id': id, 'messages': conv}
        return cur
    elif format == 'qwen':
        conv = [{'from': 'user', 'value': query}, {'from': 'assistant',                               'value': ans
                                                                }]
        cur = {'id': id, 'conversations': conv}
        return cur
    else:
        conv = [{'from': 'human', 'value': query}, {'from': 'gpt',                               'value': ans
                                                                }]
        cur = {'id': id, 'conversations': conv}
        return cur


